UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fVuHj7hD3/q8dJx6xQMNs7f2FWNAvhWOuFI21oYRy80=' 
WHERE 
  key_id = '3bc493a3c02a422aa33cdfccd34ffae7589c547eece5a33d867c0600909299aa' 
  AND (
    token = 'fVuHj7hD3/q8dJx6xQMNs7f2FWNAvhWOuFI21oYRy80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040