UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OaCvn9jOL9P72LAQUk5vmjffJZasuseEisjBrEYDJIA='
WHERE
key_id = '2eb185541be4c9dc99e5553dc98b60810250ff9f80f83698a7f25193cf9da8a0'
AND (
token = 'OaCvn9jOL9P72LAQUk5vmjffJZasuseEisjBrEYDJIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)