UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LiAET5r9PXCesHcO4inirCxbCINEBYrR/TFz53htedM=' 
WHERE 
  key_id = '79db7cbb493a19b24ab25924e7180988ca0eaf0a89ca2909c7a3f4ff4e565626' 
  AND (
    token = 'LiAET5r9PXCesHcO4inirCxbCINEBYrR/TFz53htedM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026