UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wKWv5PYvcnuluP3rIQ9CohhhlkJFs3/hsx+s48cvC6M=' 
WHERE 
  key_id = 'a65fe60a36b59ab801c913b8299ddaaab6029b174206cfc8cbdd9b9ae674969d' 
  AND (
    token = 'wKWv5PYvcnuluP3rIQ9CohhhlkJFs3/hsx+s48cvC6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039