UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cPq/yehxn2BIvkm7fV5EDav3J+g8NVyiqCEUiOmBZbo='
WHERE
key_id = 'e99342a779b35fad0f525a8a80de96695d4de267c924e46914c6bfeb631a4f43'
AND (
token = 'cPq/yehxn2BIvkm7fV5EDav3J+g8NVyiqCEUiOmBZbo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)