UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JLyCIgprxY4JxR+1GNDDSRGpqRtt3qjOt/NBnkKchWg='
WHERE
key_id = 'e5d01ea266dffc52e97c8e50e33dd18c147ad0a9b5dcd6e5997989920e4982e9'
AND (
token = 'JLyCIgprxY4JxR+1GNDDSRGpqRtt3qjOt/NBnkKchWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)