UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's1LNVf4GzrDLn9kUDGnAyTD3iYjtFLUCOkpp4SkFAzk=' 
WHERE 
  key_id = '4bc1fe9f4881a542cea16d41e8ce4e265167d9f77af25669c3446def607b9f59' 
  AND (
    token = 's1LNVf4GzrDLn9kUDGnAyTD3iYjtFLUCOkpp4SkFAzk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040