UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '71aU05YVBKFWofY2KBIpOGmoXmEr2zwVnGWn2E8DJOM=' 
WHERE 
  key_id = '80be5055401f030a14e8b7060907ac1be1bf97378d9f13275b86cd4b5d4ac8d7' 
  AND (
    token = '71aU05YVBKFWofY2KBIpOGmoXmEr2zwVnGWn2E8DJOM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027