UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LD9VeGKFLuRXGkyNcxQvj8JuZ5ZHgyZdPlMcWjZany0='
WHERE
key_id = '8da3caba5f40da28749068d4ab4b91d722113fb834ba7b19e9ebbe3147db252c'
AND (
token = 'LD9VeGKFLuRXGkyNcxQvj8JuZ5ZHgyZdPlMcWjZany0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)