UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '15Ljn9zziCXzUGAw+2Oll1MgkePrGZextXpBNpbOgKM='
WHERE
key_id = 'a77bfcd0e97525074356d54235a1976f3f8f15712e2e9e7e2ecc2bfa670a9d70'
AND (
token = '15Ljn9zziCXzUGAw+2Oll1MgkePrGZextXpBNpbOgKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)