UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mdF3PnjyfLOugbGZivoZ4am7NUKvcRGaSvTkaUVr8Og='
WHERE
key_id = '74b0cffe7cc138da09697c0b2c32776861ef07b6a5d1c2e9067f7aca174b3f22'
AND (
token = 'mdF3PnjyfLOugbGZivoZ4am7NUKvcRGaSvTkaUVr8Og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)