UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uKVADPhSe5+U/cjiMTSyjTXMWCEC2enBsfgDpO9Rtws='
WHERE
key_id = 'a36aca4eada77604a8d57506a5276bed3a83657a1f885127c9fc753ae04fbc23'
AND (
token = 'uKVADPhSe5+U/cjiMTSyjTXMWCEC2enBsfgDpO9Rtws='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)