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