UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zhPscozLBmLYBxakXBjvvQX7AsIptZ2NWQ4z97ZHBN0=' 
WHERE 
  key_id = '5b28922113e3b4da3f722b4671e8f454ac7002f2d19df86f79530d018757790e' 
  AND (
    token = 'zhPscozLBmLYBxakXBjvvQX7AsIptZ2NWQ4z97ZHBN0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052