UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v21LWgoQVRJqBV/c4bLPNJoAjtwZcj8vr0Q1RI5AhwI=' 
WHERE 
  key_id = '00a501ec3d965323d1ec528bd4304aa171d6198701cc699e89a5292c7e41e91c' 
  AND (
    token = 'v21LWgoQVRJqBV/c4bLPNJoAjtwZcj8vr0Q1RI5AhwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036