UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gowgM5VIKdYAY1xBZbRLFVOKZ6scorN3RrlolDx5YNI=' 
WHERE 
  key_id = '07009532335f75630d1e222376f8affeebc542f6401e15a0a6ff213fce184a7f' 
  AND (
    token = 'gowgM5VIKdYAY1xBZbRLFVOKZ6scorN3RrlolDx5YNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029