UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g8YKY08fjv3LqaRt4amSoQQDDB/qQVwSPYzka5QPnE0='
WHERE
key_id = 'e018b1b9099cc78a955578a4d3fddadfcbc2eb80912055de7f947e80709ede25'
AND (
token = 'g8YKY08fjv3LqaRt4amSoQQDDB/qQVwSPYzka5QPnE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)