UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sxlG+s7NYFYR2hk0MjEPqSCS2FxC6xcI9c/wSg969yw=' 
WHERE 
  key_id = '21cc4e24d37030b4e91df47816de2654a44548cd14eaa3269e3005afd6ebb59c' 
  AND (
    token = 'sxlG+s7NYFYR2hk0MjEPqSCS2FxC6xcI9c/wSg969yw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045