UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c2WNll7J/v5/nUXQTigaGREOBB9ryhnEUOEYZ2BlSeE='
WHERE
key_id = 'e2a512adbf7a1b7d169b16723e059ca7135246afb4b9536f3b93fd4c6fa59f52'
AND (
token = 'c2WNll7J/v5/nUXQTigaGREOBB9ryhnEUOEYZ2BlSeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)