UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AJUeRj0fkXTMs6hh6jJi93bdm1L2l0S6qYCOZLZal5M='
WHERE
key_id = '9514d4e33601dc62f5c4d2ac7c1e4d8cfa17f1b17af78768cf84802244f08f07'
AND (
token = 'AJUeRj0fkXTMs6hh6jJi93bdm1L2l0S6qYCOZLZal5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)