UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4GWuuxpdBmjpVk6BxHtv3Ow066bQIj6rf0HUwE2cyCQ=' 
WHERE 
  key_id = '861fce7de8dcd1a7b44f481bf25f264f247416fba4020f4e707cdf0220189258' 
  AND (
    token = '4GWuuxpdBmjpVk6BxHtv3Ow066bQIj6rf0HUwE2cyCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041