UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GpnyJxnecQzy1/PFC9aLwRwrvT9xISFcLwmrNhtJgB0='
WHERE
key_id = 'fd658368b516a42ca64c669e67dd8d4da607e32aeba60235f7ac5ba735de7f3b'
AND (
token = 'GpnyJxnecQzy1/PFC9aLwRwrvT9xISFcLwmrNhtJgB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)