UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '///FDobEg99D0Q0+dynwQnTTlHJsghzyUwJE1K9bKd4=' 
WHERE 
  key_id = '3d158305d446e6b9973e4fcfb72bf6d775dc653c11c0c8097a547098a397ac24' 
  AND (
    token = '///FDobEg99D0Q0+dynwQnTTlHJsghzyUwJE1K9bKd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029