UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mPHtT8uyXRACHWss8iftQ7hfeEAF8xV4g6SI9B5LpDo='
WHERE
key_id = 'f36e3afa507a42e8489f5c9577067fcc5c541f8c99180e97c7bc3c4a1bdd3856'
AND (
token = 'mPHtT8uyXRACHWss8iftQ7hfeEAF8xV4g6SI9B5LpDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)