UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N55NVO7pDBJmrpFl2gWerUSzEnJbKNBdQgF79RjHRgQ='
WHERE
key_id = '72d89f8c8d89ead031ec233251045472049bb43d202e542eba78d6848ec3bfa1'
AND (
token = 'N55NVO7pDBJmrpFl2gWerUSzEnJbKNBdQgF79RjHRgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)