UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JnUTUZ6jviNWp+mgt7MyDBziUYbEQA2SYhoqNY28v6A='
WHERE
key_id = '3679f24ffb2a8962e547053d541efc10f35bc6246bd428364eae849618383a33'
AND (
token = 'JnUTUZ6jviNWp+mgt7MyDBziUYbEQA2SYhoqNY28v6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)