UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VM9xdUqulOV2VE98IzUrrMnlallGJIEKwcBz4zTNytQ='
WHERE
key_id = '0194a982cfa87490977739d4728116f2c05a88c6b1ede042dce8d4544ca41ee2'
AND (
token = 'VM9xdUqulOV2VE98IzUrrMnlallGJIEKwcBz4zTNytQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)