UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HV5I2kPjsCDFOukE1EeF1cyjQWcKu9Op3B7XZUqKBeE='
WHERE
key_id = '961fb022eae26f419cc0df9742e90fe1ae9903faa8099885e5b7446f92ba3b65'
AND (
token = 'HV5I2kPjsCDFOukE1EeF1cyjQWcKu9Op3B7XZUqKBeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)