UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0xjLz0TYk10KYYEu7MB9leElB2iQrOy3naDOBw4z+sU=' 
WHERE 
  key_id = 'b4d60f067c54f18e94b84c8e8c4b295ee78ad9130d6db0956e57e405f6da8eba' 
  AND (
    token = '0xjLz0TYk10KYYEu7MB9leElB2iQrOy3naDOBw4z+sU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041