UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jj9KNzO6FzOh1AZfV8usdaRKE47EMTpVhB8ClJ3yKQU='
WHERE
key_id = 'da611e0bdf44545b894bf1c6539dfba7580d04307c6915ab45a1e8cf2fef7645'
AND (
token = 'Jj9KNzO6FzOh1AZfV8usdaRKE47EMTpVhB8ClJ3yKQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)