UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'waUnGjI/wwIzHFZq13OmJ12oMW6aJrsryFtmmPVAj5Q='
WHERE
key_id = '23e3a0ba4e4dcd7d477af3dddfa1b10c3fff5090d269cd3ac8b1ac2ce06a7742'
AND (
token = 'waUnGjI/wwIzHFZq13OmJ12oMW6aJrsryFtmmPVAj5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)