UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zgH0l4keVk95MaTygOJZIsUPN6nNHkxdGhOxOUh0++0=' 
WHERE 
  key_id = '2989ed0df6339e03d12a4d52de51f5e491df8d7745ce653bc23ead91a6bbc6d2' 
  AND (
    token = 'zgH0l4keVk95MaTygOJZIsUPN6nNHkxdGhOxOUh0++0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029