UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P1CyNSJwkJGgSHA7UlqU11XXL29r/KRJvmwUHeU+LyI='
WHERE
key_id = 'f68105402225dc65dc50a1a2dbcd2c0506b9d7a2179581b53bb80e17413bff39'
AND (
token = 'P1CyNSJwkJGgSHA7UlqU11XXL29r/KRJvmwUHeU+LyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)