UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I1grTVJ2vRmkLABxTJu3w7Q5QOChXDDjvXs/gKRM0kM='
WHERE
key_id = 'b1054046bfbafe7a728eaffc75172567735d6db7632d80bd73722e49a1f9eda0'
AND (
token = 'I1grTVJ2vRmkLABxTJu3w7Q5QOChXDDjvXs/gKRM0kM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)