UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EQI6CVOF4lPOZqzIYG0W2MXGuFvCXkxDuBbVQJjl64g='
WHERE
key_id = '049bab2f6713f40978718642ddb6c7294e2c50e39aef1c1d1170481936bc7097'
AND (
token = 'EQI6CVOF4lPOZqzIYG0W2MXGuFvCXkxDuBbVQJjl64g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)