UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DimSJ5gc3vA8ivrO1qXvj90a6SK/z+pg6iaDgaNg/6Y='
WHERE
key_id = 'b256444b58e4d0cf754113cc4a1374a1bc204b7ff32d39780de0a256dae3bfb5'
AND (
token = 'DimSJ5gc3vA8ivrO1qXvj90a6SK/z+pg6iaDgaNg/6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)