UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cUk44g3uJe4jdywakKUecECCK0TyILaKFWeSZTZb8zQ='
WHERE
key_id = '26a189779ef257baf6f29dcbab82ef80717dab9a49dfad4af36206b796af99ec'
AND (
token = 'cUk44g3uJe4jdywakKUecECCK0TyILaKFWeSZTZb8zQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)