UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mOoYMrXvke9CEGRxfl1B68mlQoRHIxXu8GNxXzYlq5o=' 
WHERE 
  key_id = 'f85a7499b258719a538643843ed34f16e7bb4827c8d73ca5af0210fdb98a6521' 
  AND (
    token = 'mOoYMrXvke9CEGRxfl1B68mlQoRHIxXu8GNxXzYlq5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023