UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P6FrWPZOEpbkBScHNazRvd4YCRp69HYpLkh3zY0Da5Q='
WHERE
key_id = 'b3022e4cc4a2b7a8ba9d476924dc14a30a4fd676bdf90b10b946b44d52117aab'
AND (
token = 'P6FrWPZOEpbkBScHNazRvd4YCRp69HYpLkh3zY0Da5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)