UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wT4NniW9JFhK30MjIY6MUUjjG6wfYJSmzZfbjrFpu0Q='
WHERE
key_id = '4fb9a424d03671b14979171c9a79a17eb305c335337a9f858cd17c5f3b0dd36e'
AND (
token = 'wT4NniW9JFhK30MjIY6MUUjjG6wfYJSmzZfbjrFpu0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)