UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ja6b4YwgoPdI574ytfaKx+OUGKdiffl5UopTVHGnyY='
WHERE
key_id = 'e6ef852c57fc1f809ea59f0cd12830dc6e65d2b75446bf9461226c4e00f76dcd'
AND (
token = '3ja6b4YwgoPdI574ytfaKx+OUGKdiffl5UopTVHGnyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)