UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hLcHtx0iDu0hRMsCAYnzb+X2ccjRHDUoH4vdANFwz7o=' 
WHERE 
  key_id = '6b606d2b452995f441263880b5371ff86484f3cc044c3475c2ae17935ddcdf6a' 
  AND (
    token = 'hLcHtx0iDu0hRMsCAYnzb+X2ccjRHDUoH4vdANFwz7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045