UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pPhUYfGHKK9fOazqMazwbA/zdxEAqhnQPPFGyc4FQXw='
WHERE
key_id = '90e0cef6667ac5083e7b325acd9f8e95f36fd292c5e26aa46f051c1d8922eb16'
AND (
token = 'pPhUYfGHKK9fOazqMazwbA/zdxEAqhnQPPFGyc4FQXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)