UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3u6ReWsxEfjYIuc9AFCaiVSbj0HCD9IkltOtWOqmwPQ='
WHERE
key_id = 'fd841319f0b343099a5ac82c047457b3605aed8894590eb44bf583f98894b3e2'
AND (
token = '3u6ReWsxEfjYIuc9AFCaiVSbj0HCD9IkltOtWOqmwPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)