UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oiTur1+ScxamMNCpZ84KpFq1Y1pMTzPqWuRINKJHysU=' 
WHERE 
  key_id = '614d59051f743d9940b38bb8525bcd40510a8b58d31789cba77469196b027510' 
  AND (
    token = 'oiTur1+ScxamMNCpZ84KpFq1Y1pMTzPqWuRINKJHysU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021