UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NL8X8wUvNrHUYPw0YlCIRUk8i+AmywvZ6UeZagjhzxU='
WHERE
key_id = '3815f4d3950b8af31fab5c4c65f9f668a171ac1a7185f0e802bffb19d95f40b2'
AND (
token = 'NL8X8wUvNrHUYPw0YlCIRUk8i+AmywvZ6UeZagjhzxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)